package tech.aistar.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.Seat;

import java.util.List;

/**
 * 本类用来演示:
 *
 * @author jyz
 * @date 2023/3/5 17:35:38
 */
@Repository
public interface SeatMapper {

    //查找全部
    @Select("select * from mm_seat")
    List<Seat> findAll();

    //通过id查找全部信息
    @Select("select * from mm_seat where id=#{id}")
    Seat getSeat(int id);

    //通过id进行删除
    @Delete("delete from mm_seat where id=#{id}")
    int delete (int id);

    //增
    @Insert("insert into mm_seat (id,type,show_id,line,column,status)values(#{id},#{type},#{show_id},#{line},#{column},#{status})")
    int save(Seat seat);

    //更新
    @Update("update mm_seat set id=#{id},type=#{type},show_id=#{show_id},line=#{line},column=#{column},status=#{status" +
            "}")
    int update(Seat seat);
}
